<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/

/**
 * Description of fwiSimpleController
 *
 * @author trunghpb
 */
abstract class fwiSimpleController implements infController {
    protected $eventTrigger = null;
    protected $viewer = null;
    protected $conf = null;

    public function __construct() {
        $this->eventTrigger = new fwiEventTrigger();
        $this->registryTrigger();
    }
    abstract protected function registryTrigger();
    
    public function runTriggerBefore($eventName){
        if ($this->eventTrigger->isTriggerBeforeExisted($eventName)){
            $triggerList = $this->eventTrigger->getTriggerBefore($eventName);
            foreach($triggerList as $trigger){
                if (method_exists($this, $trigger)){
                    $this->{$trigger}();
                }
            }
        }
    }
}
?>
